package com.xiaolin.designmode.observer;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName Subject
 * @Description 抽象主题角色
 * @Detail detail
 * @Author MyPC
 * @Date 2020/11/7
 * @Version 1.0
 */
public abstract class Subject {
    List<Observer> observers=new ArrayList<>();

    void add(Observer observer){
        observers.add(observer);
    }

    void remove(Observer observer){
        observers.remove(observer);
    }

    public abstract void notifyObserver();

}
